package com.jiawei.队列;

/**
 * @author : willian fu
 * @version : 1.0
 */
public class Test {

    public static void main(String[] args) {
        System.out.println("-------SimpleArrayQueue------");
        Queue<Integer> simpleArrayQueue = new SimpleArrayQueue<>(5);
        simpleArrayQueue(simpleArrayQueue);

        System.out.println("-------SimpleLinkedListQueue------");
        Queue<Integer> simpleLinkedListQueue = new SimpleLinkedListQueue<>();
        simpleArrayQueue(simpleLinkedListQueue);
    }

    public static void simpleArrayQueue(Queue queue){
        for (int i = 0; i < 10; i++) {
            queue.add(i);
        }
        queue.print();
        System.out.println("-------获取队列元素");
        for (int i = 0; i < 5; i++) {
            System.out.print(queue.get().toString() + " ");
        }
        queue.print();
    }
}
